// Copyright (c) Nazarii Balanda 2022
// License: MIT. More info in root project directory file 'LICENSE'

#include "data.hpp"



bool convertum::data::check_type(const std::string& TYPE) {
	if (TYPE.size() < 1 && TYPE.size() > 3)
		return false;

	static const std::regex patterns[] = {
		std::regex("[kmgtpe][bB]"),
		std::regex("[KMGTPE]i?[bB]"),
		std::regex("[bB]")
	};

	for (const auto& pattern : patterns) {
		if (std::regex_match(TYPE, pattern))
			return true;
	}

	return false;
}

